package com.wxy.care.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxy.care.entity.Count;
import com.wxy.care.entity.CountDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface CountMapper extends BaseMapper<Count> {
    @Select("select s.house_name,s.slave_id,place_str " +
            "from care.count left join sensor s " +
            "on count.house_name = s.house_name " +
            "and count.slave_id = s.slave_id " +
            "where s.house_name = #{houseName} " +
            "and date > #{preTime}")
    List<CountDto> getData(@Param("houseName") String houseName,@Param("preTime") LocalDateTime preTime);
}
